---
title: recommended-line-length
description: Check out the recommended line-length ESLint configuration to maintain optimal line lengths in your code. Enhance readability and consistency with this setup
shortDescription: All plugin rules with sorting by line length in descending order
keywords:
  - eslint
  - recommended line length config
  - eslint configuration
  - coding standards
  - code quality
  - javascript linting
  - line length sorting
  - line length configuration
  - eslint-plugin-perfectionist
  - eslint line length
  - line length rules
  - line length configuration
  - line length settings
  - line length options
  - line length best practices
  - line length guidelines
  - line length recommendations
---

import CodeTabs from '../../components/CodeTabs.svelte'
import dedent from 'dedent'

Configuration for the `eslint-plugin-perfectionist` plugin, which provides all plugin rules with preset options: sorting by string length in descending order.

This configuration will make your code prettier and more visually pleasing.

## When to Use

Use the `recommended-line-length` configuration when you want your code to look neat and visually pleasing.

This configuration is especially useful for projects where the aesthetic appearance of the code is important and where developers appreciate clean alignment and visual harmony. It helps create code that is easier to read and perceive by minimizing visual clutter and enhancing the overall structure of the code.

## Usage

<CodeTabs
  code={[
    {
      source: dedent`
        // eslint.config.js
        import perfectionist from 'eslint-plugin-perfectionist'

        export default [
          perfectionist.configs['recommended-line-length'],
        ]
      `,
      name: 'Flat Config',
      value: 'flat',
    },
    {
      source: dedent`
        // .eslintrc.js
        module.exports = {
          extends: [
            'plugin:perfectionist/recommended-line-length-legacy',
          ],
        }
      `,
      name: 'Legacy Config',
      value: 'legacy',
    },

]}
type="config-type"
client:load
lang="tsx"
/>
